/*
 * @Author: Yuluo 568055454@qq.com
 * @Date: 2023年06月18日 15:43:20
 * @LastEditors: Yuluo 568055454@qq.com
 * @LastEditTime: 2023年06月18日 17:35:21
 * @FilePath: \Mood-Blog-System\back\controllers\index.js
 * @Description: 登录/注册控制器文件
 * Copyright (c) 2023 by Yuluo, All Rights Reserved. 
 */
const LoginService = require('../services');
const { autoTransaction } = require('../util/db')
class LoginController {

    async login(ctx) {
        await autoTransaction(async (session) => {
            const res = await LoginService.login(ctx, { data: ctx.request.body, session });
        })
    }

    async register(ctx) {
        await autoTransaction(async (session) => {
            const res = await LoginService.register(ctx, { data: ctx.request.body, session });
        })
    }

}

module.exports = new LoginController();
